package dummy.randomsim

import mars.ns.core.Node
import mars.ns.core.Network
import mars.ns.EventSimulation
import mars.ns.visualisation.VisualisationListener
import mars.ns.events.RandomConnectEvent

object EventSim extends Application {
    val net:Network[Node] = new Network[Node]()
    for(i<- 0 until 100)
    	net.addNode(new Node())
    //create events
    var events:List[RandomConnectEvent[Node]] = List(new RandomConnectEvent[Node](net.getNodes().apply(50), net) ,new RandomConnectEvent[Node](net.getNodes().apply(20),net))
    println(net.getNodes().apply(50))
    println(net.getNodes().apply(20))
    
	val sim : EventSimulation[Node] = new EventSimulation[Node](net,events.size, events)
	sim.subscribe(new VisualisationListener[Node](net))
	sim.run
}